BUGFIX: Allow to insert node inside not editable content collection (via policy) #3886
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
canEdit
check is evaluated by another privilege - theEditNodePrivilege
- which is separate from theCreateNodePrivilege
to allow or disallow node creation.If
EditNodePrivilege
restricts almost all nodes except a few - say headline (bynodeIsOfType
) - andCreateNodePrivilege
does the same: only allow to create the headline (bycreatedNodeIsOfType
), this policy is correctly enforced via the cr. The Neos ui though is a little to restrictive and allows LESS than what is allowed by the core. TheEditNodePrivilege
would be required to be granted for content collections to be able to insert content. To avoid having to grant this privilege - which comes with the burden of otherwise having to allow content collections AND its subtypes which could be sliders, and to be technically correct, we just dont evaluate the can edit here.The button is still grey-d out if ALL nodes are disallowed by policy see:
neos-ui/packages/neos-ui-redux-store/src/CR/Nodes/selectors.ts
Lines 292 to 299 in 2597ffe
This behaviour has been since the introduction of Neos Ui policy evaluation: #1282
Though inside a commit shows that during the development the behavior was changed:
72b2614#diff-8b6869be808b6aad3e3ac19f6312c029d54112eb72aa09ffd757e4a7a686bcefR200
I can only assume that in "Enforce EditNodePrivilege for inline editing" the use of the
canEdit
flag was added to restrictive.What I did
How I did it
How to verify it